CC=g++
CFLAGS=-O2

BIN=../../bin/
ULIB_DIR=/home/swlee4skmt/.lib/ulib_/

ULIB_INC=-I${ULIB_DIR}include
ULIB_OBJ=${ULIB_DIR}lib/ulib.a
OBJ=../tree.o ../giza.o

all: ${OBJ}
	${CC} ${CFLAGS} avgst.cpp -o ${BIN}avgst -I.. ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
	${CC} ${CFLAGS} recov-ins.cpp -o ${BIN}recov-ins -I.. ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
	${CC} ${CFLAGS} guidiff.cpp -o ${BIN}guidiff -I.. ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
	${CC} ${CFLAGS} parse2pos.cpp -o ${BIN}parse2pos -I.. ${OBJ} ${ULIB_OBJ} ${ULIB_INC}
	${CC} ${CFLAGS} tratio.cpp -o ${BIN}tratio -I.. ${OBJ} ${ULIB_OBJ} ${ULIB_INC}

.cpp.o:
	${CC} ${CFLAGS} -c $< -o $*.o ${ULIB_INC} -I.. ${ULIB_OBJ} 

clean:
	rm -rf *.o
	rm -rf ${BIN}parse2pos ${BIN}guidiff ${BIN}recov-ins

co:
	svn co $$svn_ulib
	cd ulib; make; make install; cd ..

install:
	cp ${BIN}parse2pos ${BIN}tratio ${BIN}guidiff ${BIN}recov-ins ${BIN}avgst /home/swlee4skmt/.mybin/
